package net.mingsoft.basic.entity;

import net.mingsoft.base.entity.*;
import java.sql.*;
import org.springframework.format.annotation.*;
import com.baomidou.mybatisplus.annotation.*;
import org.apache.commons.lang3.*;
import java.util.*;
import net.mingsoft.base.constant.e.*;

@TableName("model")
public class ModelEntity extends BaseEntity
{
    @TableId(type = IdType.AUTO)
    private String id;
    private String modelTitle;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp modelDatetime;
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Integer modelId;
    private String modelUrl;
    private String modelCode;
    private String isChild;
    private String modelIcon;
    private Integer modelSort;
    @TableField(exist = false)
    private List<ModelEntity> modelChildList;
    @TableField("model_ismenu")
    private Integer modelIsMenu;
    @TableField(exist = false)
    private int chick;
    @TableField(exist = false)
    private int depth;
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String modelParentIds;
    
    public ModelEntity() {
        this.modelIcon = null;
    }
    
    public String getId() {
        if (StringUtils.isEmpty((CharSequence)this.id) || this.id.equals("0")) {
            return null;
        }
        return this.id;
    }
    
    public void setId(String id) {
        if (StringUtils.isEmpty((CharSequence)id) || id.equals("0")) {
            id = null;
        }
        this.id = id;
    }
    
    public int getDepth() {
        if (StringUtils.isNotEmpty((CharSequence)this.modelParentIds)) {
            return this.depth = this.modelParentIds.split(",").length;
        }
        return this.depth;
    }
    
    public void setDepth(final int depth) {
        this.depth = depth;
    }
    
    public Integer getModelIsMenu() {
        return this.modelIsMenu;
    }
    
    public void setModelIsMenu(final Integer modelIsMenu) {
        this.modelIsMenu = modelIsMenu;
    }
    
    public String getModelCode() {
        return this.modelCode;
    }
    
    public void setModelCode(final String modelCode) {
        this.modelCode = modelCode;
    }
    
    public String getModelIcon() {
        return this.modelIcon;
    }
    
    public void setModelIcon(final String modelIcon) {
        this.modelIcon = modelIcon;
    }
    
    public String getModelUrl() {
        return this.modelUrl;
    }
    
    public void setModelUrl(final String modelUrl) {
        this.modelUrl = modelUrl;
    }
    
    public Timestamp getModelDatetime() {
        return this.modelDatetime;
    }
    
    public void setModelDatetime(final Timestamp modelDatetime) {
        this.modelDatetime = modelDatetime;
    }
    
    public String getModelTitle() {
        return this.modelTitle;
    }
    
    public void setModelTitle(final String modelTitle) {
        this.modelTitle = modelTitle;
    }
    
    public Integer getModelSort() {
        return this.modelSort;
    }
    
    public void setModelSort(final Integer modelSort) {
        this.modelSort = modelSort;
    }
    
    public List<ModelEntity> getModelChildList() {
        return this.modelChildList;
    }
    
    public void setModelChildList(final List<ModelEntity> modelChildList) {
        this.modelChildList = modelChildList;
    }
    
    public int getChick() {
        return this.chick;
    }
    
    public void setChick(final int chick) {
        this.chick = chick;
    }
    
    public String getModelParentIds() {
        return this.modelParentIds;
    }
    
    public void setModelParentIds(final String modelParentIds) {
        this.modelParentIds = modelParentIds;
    }
    
    public String getIsChild() {
        return this.isChild;
    }
    
    public void setIsChild(final String isChild) {
        this.isChild = isChild;
    }
    
    public Integer getModelId() {
        return this.modelId;
    }
    
    public void setModelId(final Integer modelId) {
        this.modelId = modelId;
    }
    
    public boolean equals(final Object o) {
        return o != null && this.id.equals(((ModelEntity)o).getId());
    }
    
    public int hashCode() {
        return Objects.hash(this.id);
    }
    
    public enum IsMenu implements BaseEnum
    {
        NO(0), 
        YES(1);
        
        private int id;
        
        private IsMenu(final int id) {
            this.id = id;
        }
        
        public int toInt() {
            return this.id;
        }
    }
}
